package com.itheima.mapper;

import com.itheima.pojo.JobOption;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Mapper
public interface ReportMapper {
    @Select("select if(gender = 1, '男性员工', '女性员工') as name,count(*) as value from emp group by gender ")
    List<Map<String, Integer>> empGenderData();

    List<HashMap> countEmpJobData();

    @Select("SELECT \n" +
            "    CASE \n" +
            "        WHEN degree = 1 THEN '初中'\n" +
            "        WHEN degree = 2 THEN '高中'\n" +
            "        WHEN degree = 3 THEN '大专'\n" +
            "        WHEN degree = 4 THEN '本科'\n" +
            "        WHEN degree = 5 THEN '硕士'\n" +
            "        WHEN degree = 6 THEN '博士'\n" +
            "        ELSE '未知学历'\n" +
            "    END AS name,COUNT(*) AS value\n" +
            "FROM student GROUP BY degree")
    List<Map<String, Integer>> studentDegreeData();


    List<HashMap> studentCountData();
}

